package top.jacktgq;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @author weiming
 * @date 2022/9/2 11:04
 * @description
 */
@Component
@Slf4j
public class MyInit implements InitializingBean {

    private LifeCycleBean bean;



    @Autowired
    public void setBean(LifeCycleBean bean) {
        log.info("MyInit set Bean ");
        this.bean = bean;
    }

    public MyInit() {
        log.info("构造方法MyInit");
    }

    @PostConstruct
    public void init() {
        log.debug("注解初始化MyInit");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        log.info("接口初始化MyInit");
    }
}
